package com.yequan.leetcode.linkedlist;


/**
 * @author : Administrator
 * @date : 2020/3/13
 */
public class ListNode {

    public int val;
    public ListNode next;

    public ListNode(int x) {
        val = x;
    }

    public void addNode(ListNode head, int value) {
        ListNode listNode = new ListNode(value);
        ListNode currentNode = head;
        while (currentNode.next != null) {
            currentNode = currentNode.next;
        }
        currentNode.next = listNode;
    }

}
